package com.donleo.stmg.entity.service;

import com.donleo.stmg.common.api.CommonResult;
import com.donleo.stmg.entity.model.Word;
import com.baomidou.mybatisplus.extension.service.IService;
import com.donleo.stmg.entity.vo.WordVo;
import com.donleo.stmg.relation.model.WordRecord;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 单词表 服务类
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
public interface WordService extends IService<Word> {

    CommonResult add(String userCode, Word word);

    CommonResult delete(Integer id);

    CommonResult updateWord(String userCode, Word word);

    Word findById(Integer id);

    List<WordVo> findAll(String userCode, WordVo wordVo);

    long getCount(WordVo wordVo);

    /**
     * 用户点赞
     *
     * @param praiseStatus 点赞状态
     * @param wordRecord   单词记录
     */
    CommonResult userPraise(Integer praiseStatus, WordRecord wordRecord);

    /**
     * 用户收藏
     *
     * @param collectionStatus 收藏状态
     * @param wordRecord       单词记录
     */
    CommonResult userCollections(Integer collectionStatus, WordRecord wordRecord);

    /**
     * 模糊查询用户发布的单词
     */
    List<WordVo> findUserWord(String userCode,Integer type, WordVo wordVo);

    /**
     * 统计用户发布的单词
     */
    long getUserWordCount(String userCode,Integer type,WordVo wordVo);

    /**
     * 导出Excel
     */
    void exportExcel(List<Word> word, HttpServletResponse response);

}
